﻿using S.RBAC.Domain.Model;
using S.RBAC.Infrastructure.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace S.RBAC.Infrastructure.Impl
{
    public class StaffRepository : BaseRepository<Staff>, IStaffRepository
    {
        public StaffRepository(EFCoreContext context) : base(context)
        {
        }

        public async Task<int> AddStaff(Staff staff)
        {
            return await AddAsync(staff);
        }

        public async Task<List<Staff>> GetAllStaff()
        {
            return await GetAllAsync();
        }

        public async Task<Staff> GetStaffInfo(Expression<Func<Staff, bool>> expre)
        {
            return await GetInfoAsync(expre);
        }

        public async Task<List<Staff>> GetStaffList(Expression<Func<Staff, bool>> expre)
        {
            return await GetListAsync(expre);
        }

        public async Task<int> UpdStaff(Staff staff)
        {
            return await UpdateAsync(staff);
        }
    }
}
